<?php 
/**
 * 维修网点model
 * @Author    紫梦
 * @DateTime  2018-02-10
 * @copyright 响响租车
 * @license   [license]
 * @version   1.0
 */
namespace app\common\model;
use think\Model;
use traits\model\SoftDelete;

class Point extends Model
{
	use SoftDelete;
    protected $deleteTime = 'delete_time';

    // 定义全局的查询范围
    protected static function base($query)
    {
    	$agency = session('admin.agency_id');
        if($agency==1){
            $query->where('delete_time',null);

        }else{
            $query->where(['agency_id'=>$agency,'delete_time'=>null]);

        }
    		    	
    }

}